<?php
namespace App\Api\User\V1;

use PhalApi\Api;
use App\Domain\User\V1\UserDomain;

/**
 * 用户V1
 * @author JiangYongWei 2019-07-22
 */

class User extends Api {

    public function getRules() {
        return array(
            'index' => array(
                'uid' => array('name' => 'uid', 'type' => 'int', 'require' => true, 'desc' => '', 'source' => 'get'),
            ),
        );
    }

    /**
     * 用户
     * @desc 用户列表列表
     * @return int id 新增的ID
     */
    public function index() {
        $params = array(
            'uid' => $this->uid,
        );
        
        $domain = new UserDomain();
        $user = $domain->index($params);
        
        $joggingDomain = new \App\Domain\Jogging\V1\JoggingDomain();
        $jogging = $joggingDomain->index(1);
        
        $data = array(
            'jogging' => $jogging,
            'user' => $user,
        );
        return $data;
    }
}
